package observability

import (
	"github.com/prometheus/client_golang/prometheus"
)

var (
	// SearchLatency tracks search latency
	SearchLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "search_latency_seconds",
			Help:    "Search latency in seconds",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"source_type"},
	)

	// DocumentsIndexed tracks number of documents indexed
	DocumentsIndexed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "documents_indexed_total",
			Help: "Number of documents indexed by source type",
		},
		[]string{"source_type"},
	)

	// CacheHits tracks cache hit ratio
	CacheHits = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cache_hits_total",
			Help: "Number of cache hits by source type",
		},
		[]string{"source_type"},
	)
)

func init() {
	prometheus.MustRegister(SearchLatency)
	prometheus.MustRegister(DocumentsIndexed)
	prometheus.MustRegister(CacheHits)
}
